namespace CSharpPro._1013;

public class demo2
{

    public static void main()
    {
        int sum = 0;
        for (int i = 1; i <= 100; i++)
        {
            if (i % 7 != 0 && !ContainsSeven(i))
            {
                Console.Write(i + " ");
                sum += i;
            }
        }

        Console.WriteLine("\n和为：" + sum);
    }
    
    static bool ContainsSeven(int num)
    {
        while (num > 0)
        {
            if (num % 10 == 7)
            {
                return true;
            }

            num /= 10;
        }

        return false;
    }
}